<template>
  <div>
    <van-area title="选择城市" :area-list="areaList" cancel-button-text='返回' confirm-button-text='确认' @cancel="toLocation" @confirm="city"/>
  </div>
</template>

<script>
import { areaList } from '@vant/area-data';

 export default {
  data() {
    return { 
      areaList,
      };
  },
  methods: {
    toLocation() {
      this.$router.go(-1)
  },
     city(ConfirmResult){
       console.log(ConfirmResult[1].name);
       this.ConfirmResult = ConfirmResult;
       this.$store.commit('setCity',this.ConfirmResult[1].name)
       this.$router.push('/location')
     }
  },
  
};
</script>

<style  scoped>

</style>